package com.dkd.http.controller;

import com.dkd.entity.PartnerEntity;
import com.dkd.service.PartnerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 合作商管理
 */
@RestController
@RequestMapping("/partner")
@RequiredArgsConstructor
public class PartnerController {
    private final PartnerService partnerService;
    @GetMapping("/contact")
    public PartnerEntity getPartnerByName(String Name){
        return partnerService.lambdaQuery().eq(PartnerEntity::getContact,Name).one();
    }
    @GetMapping("/count")
    public Integer count(){
        return partnerService.count();
    }
}
